package cn.jilian.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import cn.jilian.entity.User;

public interface UserDAO extends PagingAndSortingRepository<User, Long> {
	
	@Query(value="select max(seq) as max from User where fid=?1 and rank=?2")
	Integer getMaxSeq(Long fid,Integer rank);
	
	User findByUsername(String username);
	
	Page<User> findByUnitId(Long unid,Pageable page);

}
